diamondfirefandomcom-20200213-history
Player Action
The Player Action is the third codeblock in the DiamondFire codeblock roster. It has the appearance of a cobblestone block and is used to affect players directly. Actions The Player Action block includes 8 categories of code actions. Item Management The Item Management category focuses on item manipulation, custom GUIs, and inventories. Give Items The Give Items code action will give the selected player whichever items are in the chest when run. Set Items The Set Items code action will set the items in the chest in the selected player's inventory. It will override any current items already in a set slot. The setting functions as following: The top row is the player's hotbar, the second row is the player's topmost inventory row, and the third row is the middle inventory row. There is currently no way to set the bottom inventory row with the Set Items code action. Set Armor The Set Armor code action will set items in the selected player's armor slots. Slot 1 corresponds to the helmet, Slot 2 corresponds to the chestplate, Slot 3 corresponds to the leggings, and Slot 4 corresponds to the boots. You can place any item in any slot, but all items will only be visible in the helmet slot. Set Item in Off Hand The Set Item in Off Hand code action will set the item in the chests in the selected player's off hand slot. It will override any current items already in that slot. Remove Items The Remove Items code action will remove all items in the chest from the selected player's inventory. If a player has less of an item than specified in the chest, the items will NOT be removed. This does not affect items being dragged by the cursor. * Dev Tip: To remove ALL of a player's items and bypassing the skip, grab a stack of the item to remove, then keep halving it until you have 32,16,8,4,2,1,1. This will remove all parts of a stack. Clear Inventory The Clear Inventory code action will completely remove all items from the selected player's inventory. This code action has a slight wait before activating. Show Inventory Menu The Show Inventory Menu code action will display a custom plot interface to the selected player, looking like a chest with 3 rows. The contents of the GUI will mirror the chest that runs this code action. Items cannot be taken out of the inventory in any way. * This action is Emperor+ Exclusive Close All Inventory Menus The Close All Inventory Menus code action will clear all of the selected player's custom plot inventories as well as chat, any kind of crafting GUIs, enchanting, etc... * This action is Emperor+ Exclusive Expand Inventory Menu The Expand Inventory Menu code action will enlarge the selected player's custom plot inventory by 3 rows below the original, also mirroring the contents of the chest. The final result would look like a Large Chest GUI. Items still cannot be taken out of the inventory in any way. * This action is Emperor+ Exclusive Save Current Inventory The Save Current Inventory code action will internally store the selecter player's player inventory. It can be loaded later using the Load Saved Inventory ''code action. The saved inventory persists even after leaving the plot. * This action is Noble+ Exclusive Load Saved Inventory The Load Saved Inventory code action will set the selected player's entire inventory to their previoiusly saved inventory through ''Save Current Inventory. It will override any existing items in a player's inventory. * This code action will load for a brief period of time before actually loading. * This action is Noble+ Exclusive Set Hotbar Slot The Set Hotbar Slot code action will set the selected player's selected hotbar slot to the one specified by a Number in the chest. This action triggers the ''Player Change Slot ''Event. Give Random Item The Give Random Item code action will give pick an item at random from the contents of the chest and give it to the selected player. Placing multiple of the same item increases the likelyhood if that item being chosen. * This action is only unlockable with Credits. Category:Code Blocks